export default {
    namespaced: true, // 命名空间开启
    state: {
        UserToken: "",
        userRoles: "",
    },
    mutations: {
        LoginIn(state, data) {

            state.UserToken = data.token
            state.userRoles = data.data // 角色

            localStorage.setItem("token", data.token) // token 令牌
            localStorage.setItem("roles", data.data) // 角色

        },
        LoginOut(state) {
            state.UserToken = ""
            state.userRoles = ""

            localStorage.removeItem("token")
            localStorage.removeItem("roles")
        },
    }
}